package net.mushystuff.dogalogue.beans;

import java.io.Serializable;
import java.util.UUID;

import javax.persistence.Id;
import javax.persistence.MappedSuperclass;
import javax.persistence.Version;

import org.hibernate.annotations.GenericGenerator;

@MappedSuperclass
public abstract class DogalogueBean implements Serializable {

	private String id = UUID.randomUUID().toString();
	
	private int version;
	
	protected DogalogueBean() {
	}

	@Id @GenericGenerator(name="generator", strategy="assigned")
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@Version
	public int getVersion() {
		return version;
	}

	public void setVersion(int version) {
		this.version = version;
	}
	
}
